package L2;

import java.util.Scanner;

public class BackUp {
    public static void main(String[] args) {
        int count = 0;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        int temp;
        int sum = 0;
        int i;
        Scanner sc = new Scanner(System.in);
        count = sc.nextInt();
        for (i = 0; i < count; i++) {
            temp = sc.nextInt();
            if (temp > max) {
                max = temp;
            } else if (temp < min) {
                min = temp;
            }
            sum += temp;
        }
        sc.close();
        sum -= max;
        sum -= min;
        System.out.printf("max = %d%nmin = %d%nave = %f",max,min,sum/(double)(count-2));
    }
}
